#ifndef OBJECTWORKERTHREAD_H
#define OBJECTWORKERTHREAD_H

#include <QObject>
#include <QStringList>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>
#include <QDebug>
#include <QFileInfo>
#include <QFile>
class ObjectWorkerThread : public QObject
{
    Q_OBJECT
public:
    explicit ObjectWorkerThread(QObject *parent = nullptr);
    ~ObjectWorkerThread();
    void printFirst10Records();
    QSqlDatabase    db2;
    QStringList m_times;    // 存储当前时间
    QStringList m_currents; // 存储电流
    QStringList m_voltages; // 存储电压
    QStringList m_powers;   // 存储功率

signals:
    void finished(); // 信号：线程任务结束
    void dataReady(const QStringList &times, const QStringList &currents,
                   const QStringList &voltages, const QStringList &powers);

public slots:
    void process(); // 线程任务函数
    // Getter 函数
    QStringList getTimes() const { return m_times; }
    QStringList getCurrents() const { return m_currents; }
    QStringList getVoltages() const { return m_voltages; }
    QStringList getPowers() const { return m_powers; }
private:

};

#endif // OBJECTWORKERTHREAD_H
